package com.fy.fyai.common.ex.handler;

import com.fy.fyai.common.ex.ConditionException;
import lombok.extern.slf4j.Slf4j;

/**
 * 异常处理工具类
 */
@Slf4j
public class ExHandler {

    /**抛出条件异常
     *
     * @param condition
     * @param message
     */
    public static void throwIf(boolean condition, String message) {
        if (condition) {
            throw new ConditionException(message);
        }
    }

    /**抛出条件异常
     *
     * @param message
     */
    public static void throwIf( String message) {
        throw new ConditionException(message);
    }
}